From 78c201d8d9d2f3ec07f6ea36201977846e29ccd9 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 4 Feb 2026 12:42:42 -0800 Subject: homepage design and currency toggling --- src/routes/(app)/payment/[id]/+page.svelte | 40 +++++++++++++++++------- src/routes/(app)/payment/[id]/plain/+page.svelte | 19 +++++++++-- 2 files changed, 44 insertions(+), 15 deletions(-) (limited to 'src/routes/(app)/payment/[id]') diff --git a/src/routes/(app)/payment/[id]/+page.svelte b/src/routes/(app)/payment/[id]/+page.svelte index f91f2f26..b4120adb 100644 --- a/src/routes/(app)/payment/[id]/+page.svelte +++ b/src/routes/(app)/payment/[id]/+page.svelte @@ -14,6 +14,13 @@ success, types, } from "$lib/utils"; + import { fiat } from "$lib/store"; + + const toggleFiat = (e) => { + e.preventDefault(); + e.stopPropagation(); + $fiat = !$fiat; + }; import Avatar from "$comp/Avatar.svelte"; import { format } from "date-fns"; import { PUBLIC_EXPLORER, PUBLIC_LIQUID_EXPLORER } from "$env/static/public"; @@ -79,18 +86,27 @@ {#snippet field(title, amount)}
{$t(title)} -
-
- {s(amount, userLocale)} -
- - {f(toFiat(amount, rate), currency, userLocale)} - -
+
{/snippet} diff --git a/src/routes/(app)/payment/[id]/plain/+page.svelte b/src/routes/(app)/payment/[id]/plain/+page.svelte index 5dc82ce3..8e3fe8f3 100644 --- a/src/routes/(app)/payment/[id]/plain/+page.svelte +++ b/src/routes/(app)/payment/[id]/plain/+page.svelte @@ -14,6 +14,7 @@ success, types, } from "$lib/utils"; + import { fiat } from "$lib/store"; import Avatar from "$comp/Avatar.svelte"; import { format } from "date-fns"; import { PUBLIC_EXPLORER as expl } from "$env/static/public"; @@ -40,7 +41,11 @@
Amount
- {f(toFiat(a, rate), currency)} + {#if $fiat} + {f(toFiat(a, rate), currency)} + {:else} + {s(a)} + {/if}
@@ -48,7 +53,11 @@
Tip
- {f(toFiat(tip, rate), currency)} + {#if $fiat} + {f(toFiat(tip, rate), currency)} + {:else} + {s(tip)} + {/if} ({Math.round((tip * 100) / Math.abs(a))}%)
@@ -56,7 +65,11 @@
Total
- {f(toFiat(a + (tip || 0), rate), currency)} + {#if $fiat} + {f(toFiat(a + (tip || 0), rate), currency)} + {:else} + {s(a + (tip || 0))} + {/if}
{/if} -- cgit v1.2.3